<head>
    <meta charset="UTF-8">
<title>算法训练 麦森数</title>
<link rel="stylesheet" href="../css/main.css">
</head>
 <p class="a">【问题描述】</p>
<p class="a">形如<span lang="EN-US">2<i><sup>P</sup></i>-1</span>的素数称为麦森数，这时<span lang="EN-US">P</span>一定也是个素数。但反过来不一定，即如果<span lang="EN-US">P</span>是个素数，<span lang="EN-US">2<i><sup>P</sup></i>-1</span>不一定也是素数。到<span lang="EN-US">1998</span>年底，人们已找到了<span lang="EN-US">37</span>个麦森数。最大的一个是<span lang="EN-US">P=3021377</span>，它有<span lang="EN-US">909526</span>位。麦森数有许多重要应用，它与完全数密切相关。</p>
<p class="a">任务：从文件中输入<span lang="EN-US">P</span>（<span lang="EN-US">1000&lt;P&lt;3100000</span>），计算<span lang="EN-US">2<i><sup>P</sup></i>-1</span>的位数和最后<span lang="EN-US">500</span>位数字（用十进制高精度数表示）</p>
<p class="a">【输入格式】</p>
<p class="a">文件中只包含一个整数<span lang="EN-US">P</span>（<span lang="EN-US">1000&lt;P&lt;3100000</span>）</p>
<p class="a">【输出格式】</p>
<p class="a">第一行：十进制高精度数<span lang="EN-US">2<i><sup>P</sup></i>-1</span>的位数。</p>
<p class="a">第<span lang="EN-US">2-11</span>行：十进制高精度数<span lang="EN-US">2<i><sup>P</sup></i>-1</span>的最后<span lang="EN-US">500</span>位数字。（每行输出<span lang="EN-US">50</span>位，共输出<span lang="EN-US">10</span>行，不足<span lang="EN-US">500</span>位时高位补<span lang="EN-US">0</span>）</p>
<p class="a">不必验证<span lang="EN-US">2<i><sup>P</sup></i>-1</span>与<span lang="EN-US">P</span>是否为素数。</p>
<p class="a">【输入样例】</p>
<p class="a"><span lang="EN-US">1279&nbsp;</span></p>
<p class="a">【输出样例】</p>
<p class="a"><span lang="EN-US">386</span></p>
<p class="a"><span lang="EN-US"> 00000000000000000000000000000000000000000000000000</span></p>
<p class="a"><span lang="EN-US"> 00000000000000000000000000000000000000000000000000</span></p>
<p class="a"><span lang="EN-US"> 00000000000000104079321946643990819252403273640855</span></p>
<p class="a"><span lang="EN-US"> 38615262247266704805319112350403608059673360298012</span></p>
<p class="a"><span lang="EN-US"> 23944173232418484242161395428100779138356624832346</span></p>
<p class="a"><span lang="EN-US"> 49081399066056773207629241295093892203457731833496</span></p>
<p class="a"><span lang="EN-US"> 61583550472959420547689811211693677147548478866962</span></p>
<p class="a"><span lang="EN-US"> 50138443826029173234888531116082853841658502825560</span></p>
<p class="a"><span lang="EN-US"> 46662248318909188018470682222031405210266984354887</span></p>
<p class="a"><span lang="EN-US"> 32958028878050869736186900714720710555703168729087</span></p>